Skip to content

[SPARK-45522][BUILD][CORE][SQL][UI] Migrate from Jetty 9 to Jetty 10#43765

Closed
HiuKwok wants to merge 19 commits into
apache:masterfrom
HiuKwok:ft-hf-SPARK-45522-jetty-upgradte
Closed

[SPARK-45522][BUILD][CORE][SQL][UI] Migrate from Jetty 9 to Jetty 10#43765
HiuKwok wants to merge 19 commits into
apache:masterfrom
HiuKwok:ft-hf-SPARK-45522-jetty-upgradte

Conversation

@HiuKwok

@HiuKwok HiuKwok commented Nov 11, 2023

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This is an upgrade ticket to bump the Jetty version from 9 to 10.
This PR aims to bring incremental Jetty upgrades to Spark, as Jetty 9 support already reached EOL.

Why are the changes needed?

Jetty 9 is already beyond EOL, which means that we won't receive any security fix onward for Spark.

Does this PR introduce any user-facing change?

No, SNI host check is now defaulted to true on embedded Jetty, hence set it back to false to maintain backward compatibility.
Despite the redirect behaviour changed for trailing /, but modern browser should be able to pick up the 302 status code and perform redirect accordingly, hence there is no impact on user level.

How was this patch tested?

Junit test case.

Was this patch authored or co-authored using generative AI tooling?

No

Comment thread pom.xml
Comment thread core/pom.xml
@HiuKwok HiuKwok force-pushed the ft-hf-SPARK-45522-jetty-upgradte branch from 0df2668 to 59809f6 Compare January 21, 2024 11:10
@HiuKwok HiuKwok changed the title SPARK-45522: [WIP] Jetty 9 -12 upgrade SPARK-45522: Jetty 9 -> 10 upgrade Jan 21, 2024
@HiuKwok

HiuKwok commented Jan 21, 2024

Copy link
Copy Markdown
Contributor Author

Checking the build failure

@HiuKwok HiuKwok marked this pull request as draft January 23, 2024 11:19
@github-actions github-actions Bot added the SQL label Jan 23, 2024
@LuciferYang

Copy link
Copy Markdown
Contributor

[error] /home/runner/work/spark/spark/core/src/test/scala/org/apache/spark/ui/UISuite.scala:415: File line length exceeds 100 characters

@HiuKwok

HiuKwok commented Jan 27, 2024

Copy link
Copy Markdown
Contributor Author

I have fixed the code style and other miscellaneous linter errors, right now I'm investigating the Python test case fail, for PySpark connect.

@LuciferYang

Copy link
Copy Markdown
Contributor

Comment thread core/src/main/scala/org/apache/spark/TestUtils.scala Outdated
Comment thread core/src/main/scala/org/apache/spark/ui/JettyUtils.scala
Comment thread pom.xml Outdated
Comment thread core/src/main/scala/org/apache/spark/ui/JettyUtils.scala Outdated
@srowen

srowen commented Jan 30, 2024

Copy link
Copy Markdown
Member

This is a good step - we should try to get to Jetty 11 next before Spark 4, or even Jetty 12

@LuciferYang LuciferYang changed the title SPARK-45522: Jetty 9 -> 10 upgrade [SPARK-45522][BUILD][CORE][SQL][UI] Migrate from Jetty 9 to Jetty 10 Jan 30, 2024
HiuKwok and others added 3 commits January 31, 2024 12:45
Co-authored-by: Kent Yao <yao@apache.org>
Co-authored-by: YangJie <yangjie01@baidu.com>
@HiuKwok HiuKwok marked this pull request as ready for review January 31, 2024 10:10
@HiuKwok

HiuKwok commented Jan 31, 2024

Copy link
Copy Markdown
Contributor Author

Resolved all comments.

@HiuKwok HiuKwok requested a review from LuciferYang January 31, 2024 10:11
@srowen srowen closed this in 6c19bf6 Jan 31, 2024
@srowen

srowen commented Jan 31, 2024

Copy link
Copy Markdown
Member

Merged to master

@pan3793

pan3793 commented May 13, 2024

Copy link
Copy Markdown
Member

@srowen @dongjoon-hyun @LuciferYang @yaooqinn @cloud-fan @HiuKwok

Unfortunately, we identified the compatibility issue on Jetty 11, and it is likely to revert Jetty 11 upgrading, see details in SPARK-48238. If we downgrade Jetty, which version we want to keep, 9 or 10?

I would prefer 9, because I think

  1. both of those versions are End of Community Support, but still receiving critical CVE fixes
  2. some downstream projects may extend Spark UI tabs, e.g. Apache Kyuubi, Apache Gluten, keep using Jetty 9 as Spark 3 does would reduce the potential compatibility issues
  3. Jetty 9 might live longer than Jetty 10

jetty/jetty.project#10103 (comment)

Jetty 9.4 EOL and Jetty 10/11 EOL are only very loosely related.

This is because Java 8 (minimum requirement for Jetty 9.4) currently has longer support from Java vendors than Java 11 (minimum requirement for Jetty 10/11).
Certain vendors support Java 8 until 2030, but Java 11 only until 2026, for example.

For this reason, it may be possible that Jetty 10/11 will go in EOL at a different time than Jetty 9.4, possibly even earlier.

jetty/jetty.project#10485

... specifically that 1 January 2024 will mark the official End of Community Support(EoCS) for Jetty 10 and Jetty 11.

@LuciferYang

Copy link
Copy Markdown
Contributor

@srowen @dongjoon-hyun @LuciferYang @yaooqinn @cloud-fan @HiuKwok

Unfortunately, we identified the compatibility issue on Jetty 11, and it is likely to revert Jetty 11 upgrading, see details in SPARK-48238. If we downgrade Jetty, which version we want to keep, 9 or 10?

I would prefer 9, because I think

  1. both of those versions are End of Community Support, but still receiving critical CVE fixes
  2. some downstream projects may extend Spark UI tabs, e.g. Apache Kyuubi, Apache Gluten, keep using Jetty 9 as Spark 3 does would reduce the potential compatibility issues
  3. Jetty 9 might live longer than Jetty 10

jetty/jetty.project#10103 (comment)

Jetty 9.4 EOL and Jetty 10/11 EOL are only very loosely related.
This is because Java 8 (minimum requirement for Jetty 9.4) currently has longer support from Java vendors than Java 11 (minimum requirement for Jetty 10/11).
Certain vendors support Java 8 until 2030, but Java 11 only until 2026, for example.
For this reason, it may be possible that Jetty 10/11 will go in EOL at a different time than Jetty 9.4, possibly even earlier.

jetty/jetty.project#10485

... specifically that 1 January 2024 will mark the official End of Community Support(EoCS) for Jetty 10 and Jetty 11.

+1 for 9.x

@HiuKwok

HiuKwok commented May 13, 2024

Copy link
Copy Markdown
Contributor Author

@srowen @dongjoon-hyun @LuciferYang @yaooqinn @cloud-fan @HiuKwok

Unfortunately, we identified the compatibility issue on Jetty 11, and it is likely to revert Jetty 11 upgrading, see details in SPARK-48238. If we downgrade Jetty, which version we want to keep, 9 or 10?

I would prefer 9, because I think

  1. both of those versions are End of Community Support, but still receiving critical CVE fixes
  2. some downstream projects may extend Spark UI tabs, e.g. Apache Kyuubi, Apache Gluten, keep using Jetty 9 as Spark 3 does would reduce the potential compatibility issues
  3. Jetty 9 might live longer than Jetty 10

jetty/jetty.project#10103 (comment)

Jetty 9.4 EOL and Jetty 10/11 EOL are only very loosely related.
This is because Java 8 (minimum requirement for Jetty 9.4) currently has longer support from Java vendors than Java 11 (minimum requirement for Jetty 10/11).
Certain vendors support Java 8 until 2030, but Java 11 only until 2026, for example.
For this reason, it may be possible that Jetty 10/11 will go in EOL at a different time than Jetty 9.4, possibly even earlier.

jetty/jetty.project#10485

... specifically that 1 January 2024 will mark the official End of Community Support(EoCS) for Jetty 10 and Jetty 11.

Agree.

@cloud-fan

Copy link
Copy Markdown
Contributor

Thanks for the discussion here! @HiuKwok are you going to do the revert work? If not please let us know and we can help.

dongjoon-hyun added a commit that referenced this pull request Apr 19, 2026
### What changes were proposed in this pull request?

As a part of [SPARK-55556: Improve Web Security](https://issues.apache.org/jira/browse/SPARK-55556), this PR introduces a new configuration `spark.ui.jetty.sniHostCheckEnabled` that controls Jetty's SNI host check on the Spark UI HTTPS connector. `sniHostCheck` is recommended by Jetty community as we can see that the default value of Jetty is `true` already. The previously Spark-side hardcoded `SecureRequestCustomizer.setSniHostCheck(false)` call in `JettyUtils` is replaced with a value driven by this configuration.

The default value is `false`, preserving the existing behavior introduced in SPARK-45522.
- #43765

### Why are the changes needed?

In the Jetty usage, `jetty.ssl.sniHostCheck=false` is supposed to override the default behavior. However, since SPARK-45522 (Jetty 10+), Spark has set `SniHostCheck` to `false` strictly to preserve backward compatibility with standalone deployments. Operators who want stricter host checking for security have no way to enable it without patching source. Exposing this as a configuration lets users opt in to SNI host checking when desired.

### Does this PR introduce _any_ user-facing change?

No. A new configuration `spark.ui.jetty.sniHostCheckEnabled` (default: `false`) is added in Spark 4.2.0. The default preserves the current behavior, so existing deployments are unaffected.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.7)

Closes #55396 from dongjoon-hyun/dongjoon/pensive-hugle-48097c.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants